Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(typecheck): StackedContexts for blocks #3305

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

snprajwal
Copy link
Contributor

@snprajwal snprajwal commented Dec 16, 2024

Replaces the DIY vector stack with a StackedContexts object for block
scopes in the type checker context.

Fixes #3284.

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check.h (class TypeCheckContext): add
header file and use StackedContexts for blocks
* typecheck/rust-typecheck-context.cc: update methods
* typecheck/rust-hir-trait-resolve.cc: refactor function calls
* typecheck/rust-hir-type-check-implitem.cc: refactor function calls
* typecheck/rust-hir-type-check-type.cc: refactor function calls

Signed-off-by: Prajwal S N [email protected]

Replaces the DIY vector stack with a StackedContexts object for block
scopes in the type checker context.

Fixes Rust-GCC#3284.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check.h (class TypeCheckContext): add
	header file and use StackedContexts for blocks
	* typecheck/rust-typecheck-context.cc: update methods
	* typecheck/rust-hir-trait-resolve.cc: refactor function calls
	* typecheck/rust-hir-type-check-implitem.cc: refactor function calls
	* typecheck/rust-hir-type-check-type.cc: refactor function calls

Signed-off-by: Prajwal S N <[email protected]>
Copy link
Member

@CohenArthur CohenArthur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use StackedContexts class in lieu of TypeCheckContext::block_stack
2 participants